package org.chen.spring.cloud.finchley.controller;

import org.chen.spring.cloud.finchley.service.ProviderFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chensj
 * @date 2020-02-07 17:09
 */
@RestController
public class ConsumerController {
    /**
     * 注入服务提供者,远程的Http服务
     */
    @Autowired
    private ProviderFeignService providerFeignService;

    /**
     * 服务消费者对位提供的服务
     *
     * @return str
     */
    @GetMapping("/consumer/feign")
    public String findByIdByEurekaServer() {
        return providerFeignService.helloFeign();

    }
}
